package com.lesserpand.springcloudalibabasso.fallback;

import com.lesserpand.springcloudalibabasso.feign.SecurityOauthFeign;
import com.lesserpand.springcloudalibabasso.security.entity.AccessTokenBO;
import com.lesserpand.springcloudalibabasso.security.entity.SecurityOauthThreeDO;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author bailuo
 * @version 2.0
 * @Description TODO
 * @Date Created in 2018/12/11 14:18
 */
@Component(value = "securityOauthFeignFallbackFactory")
public class SecurityOauthFeignFallbackFactory implements FallbackFactory<SecurityOauthFeign> {
    @Override
    public SecurityOauthFeign create(Throwable throwable) {
        return new SecurityOauthFeign(){

            @Override
            public String authorize(String clientId, String redirectUri) {
                return null;
            }

            @Override
            public SecurityOauthThreeDO getAccessToken(String code, String clientId, String clientSecret, String redirectUri) {
                return null;
            }

            @Override
            public AccessTokenBO getAccessTokenByPassword(String username, String password) {
                return null;
            }
        };
    }
}
